function loadFile()
{
  
  var username = document.getElementById("datafile");
  document.writeln("<img src='"+username+"' />");
  
  if (username=="")
  {
    document.getElementById("txtHint").innerHTML="";
    return;
  } 
  
  if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  }
  else
  {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function()
  {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
      if (xmlhttp.responseText != "") {
        document.getElementById("response").innerHTML="Username dan password benar!";
        window.location.href=window.location.href
      } else {
        document.getElementById("response").innerHTML="Username atau password salah!";
      }
    }
  }
  
  xmlhttp.open("GET","getuser.php?q="+username+"&w="+password,true);
  xmlhttp.send();
  
}

function markAll()
{
  document.getElementById("f1").checked = true;
  document.getElementById("f2").checked = true;
  document.getElementById("f3").checked = true;
  document.getElementById("f4").checked = true;
  document.getElementById("f5").checked = true;
  document.getElementById("f6").checked = true;
  document.getElementById("f7").checked = true;
  document.getElementById("f8").checked = true;
  document.getElementById("f9").checked = true;
  document.getElementById("f10").checked = true;
  document.getElementById("f11").checked = true;
  document.getElementById("f12").checked = true;
  document.getElementById("f13").checked = true;
  document.getElementById("f14").checked = true;
  document.getElementById("f15").checked = true;
  document.getElementById("f16").checked = true;
  document.getElementById("f17").checked = true;
  document.getElementById("f18").checked = true;
  document.getElementById("f19").checked = true;
  document.getElementById("f20").checked = true;
  document.getElementById("f21").checked = true;
  document.getElementById("f22").checked = true;
}

function unmarkAll()
{
  document.getElementById("f1").checked = false;
  document.getElementById("f2").checked = false;
  document.getElementById("f3").checked = false;
  document.getElementById("f4").checked = false;
  document.getElementById("f5").checked = false;
  document.getElementById("f6").checked = false;
  document.getElementById("f7").checked = false;
  document.getElementById("f8").checked = false;
  document.getElementById("f9").checked = false;
  document.getElementById("f10").checked = false;
  document.getElementById("f11").checked = false;
  document.getElementById("f12").checked = false;
  document.getElementById("f13").checked = false;
  document.getElementById("f14").checked = false;
  document.getElementById("f15").checked = false;
  document.getElementById("f16").checked = false;
  document.getElementById("f17").checked = false;
  document.getElementById("f18").checked = false;
  document.getElementById("f19").checked = false;
  document.getElementById("f20").checked = false;
  document.getElementById("f21").checked = false;
  document.getElementById("f22").checked = false;
}

function inverseAll()
{
  if (document.getElementById("f1").checked == false)
  {
    document.getElementById("f1").checked = true;
  }
  else 
  {
    document.getElementById("f1").checked = false;
  }
  
  if (document.getElementById("f2").checked == false)
  {
    document.getElementById("f2").checked = true;
  }
  else 
  {
    document.getElementById("f2").checked = false;
  }
  
  if (document.getElementById("f3").checked == false)
  {
    document.getElementById("f3").checked = true;
  }
  else 
  {
    document.getElementById("f3").checked = false;
  }
  
  if (document.getElementById("f4").checked == false)
  {
    document.getElementById("f4").checked = true;
  }
  else 
  {
    document.getElementById("f4").checked = false;
  }
  
  if (document.getElementById("f5").checked == false)
  {
    document.getElementById("f5").checked = true;
  }
  else 
  {
    document.getElementById("f5").checked = false;
  }
  
  if (document.getElementById("f6").checked == false)
  {
    document.getElementById("f6").checked = true;
  }
  else 
  {
    document.getElementById("f6").checked = false;
  }
  
  if (document.getElementById("f7").checked == false)
  {
    document.getElementById("f7").checked = true;
  }
  else 
  {
    document.getElementById("f7").checked = false;
  }
  
  if (document.getElementById("f8").checked == false)
  {
    document.getElementById("f8").checked = true;
  }
  else 
  {
    document.getElementById("f8").checked = false;
  }
  
  if (document.getElementById("f9").checked == false)
  {
    document.getElementById("f9").checked = true;
  }
  else 
  {
    document.getElementById("f9").checked = false;
  }
  
  if (document.getElementById("f10").checked == false)
  {
    document.getElementById("f10").checked = true;
  }
  else 
  {
    document.getElementById("f10").checked = false;
  }
  
  if (document.getElementById("f11").checked == false)
  {
    document.getElementById("f11").checked = true;
  }
  else 
  {
    document.getElementById("f11").checked = false;
  }
  
  if (document.getElementById("f12").checked == false)
  {
    document.getElementById("f12").checked = true;
  }
  else 
  {
    document.getElementById("f12").checked = false;
  }
  
  if (document.getElementById("f13").checked == false)
  {
    document.getElementById("f13").checked = true;
  }
  else 
  {
    document.getElementById("f13").checked = false;
  }
  
  if (document.getElementById("f14").checked == false)
  {
    document.getElementById("f14").checked = true;
  }
  else 
  {
    document.getElementById("f14").checked = false;
  }
  
  if (document.getElementById("f15").checked == false)
  {
    document.getElementById("f15").checked = true;
  }
  else 
  {
    document.getElementById("f15").checked = false;
  }
  
  if (document.getElementById("f16").checked == false)
  {
    document.getElementById("f16").checked = true;
  }
  else 
  {
    document.getElementById("f16").checked = false;
  }
  
  if (document.getElementById("f17").checked == false)
  {
    document.getElementById("f17").checked = true;
  }
  else 
  {
    document.getElementById("f17").checked = false;
  }
  
  if (document.getElementById("f18").checked == false)
  {
    document.getElementById("f18").checked = true;
  }
  else 
  {
    document.getElementById("f18").checked = false;
  }
  
  if (document.getElementById("f19").checked == false)
  {
    document.getElementById("f19").checked = true;
  }
  else 
  {
    document.getElementById("f19").checked = false;
  }
  if (document.getElementById("f20").checked == false)
  {
    document.getElementById("f20").checked = true;
  }
  else 
  {
    document.getElementById("f20").checked = false;
  }
  
  if (document.getElementById("f21").checked == false)
  {
    document.getElementById("f21").checked = true;
  }
  else 
  {
    document.getElementById("f21").checked = false;
  }
  
  if (document.getElementById("f22").checked == false)
  {
    document.getElementById("f22").checked = true;
  }
  else 
  {
    document.getElementById("f22").checked = false;
  }
  
}